package com.onesports.intelligent.k12.polarlight.domain.dto.course;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.onesports.framework.kit.common.valid.Json;
import com.onesports.intelligent.k12.polarlight.security.SecurityUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;


/**
 * ${comments}
 *
 * @author
 * @since 1.0.0 2022-07-08
 */
@Data
@ApiModel(value = "排课表DTO")
public class CourseScheduleDTO {
    private static final long serialVersionUID = 1L;


    @ApiModelProperty(value = "课表id 新增操作不传  修改必传")
    private String id;

    @ApiModelProperty(value = "校区id", required = true)
    @NotBlank(message = "请选择校区")
    private String campusId;


    @ApiModelProperty(value = "课表名称", required = true)
    @NotBlank(message = "请输入课表名称")
    @Length(max = 50, message = "课表名称字数不可超过50")
    private String scheduleName;


    @ApiModelProperty(value = "课程配置id", required = true)
    @NotBlank(message = "请选择课程")
    private String courseId;


    @ApiModelProperty(value = "排课方式：1按星期  2：按日期", required = true)
    @NotBlank(message = "请选择排课方式")
    private String courseType;


    @ApiModelProperty(value = "上课开始日期", required = true)
    @NotNull(message = "请选择开始日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date startDate;


    @ApiModelProperty(value = "上课结束日期", required = true)
    @NotNull(message = "请选择结束日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date endDate;


    @ApiModelProperty(value = "星期code集合(排课方式为1时，该值必传)  周一  ： 1  周二 ： 2 后面数字顺延")
    private String[] weekCode;


    @ApiModelProperty("日期集合 选日期传这个字段")
    private List<String> dates;


    @ApiModelProperty(value = "是否发布 true: 是  false: 否", required = true)
    @NotNull(message = "请选择发布状态")
    private Boolean publishStatus;


    @ApiModelProperty(value = "机构id", hidden = true)
    private String organizationId = SecurityUtils.getOrganizationId();


}
